import TreeNode from "./treeNode";

export enum Colors {
  Red,
  Black
}

export class RedBlackNode<T> extends TreeNode<T> {
  key: T;
  left: RedBlackNode<T> | null;
  right: RedBlackNode<T> | null;
  color: Colors;
  parent: RedBlackNode<T> | null;

  constructor(key: T) {
    super(key);
    this.left = null;
    this.right = null;
    this.key = key;
    this.color = Colors.Red;
    this.parent = null;
  }

  isRed() {
    return this.color === Colors.Red;
  }
}
